/**
 * Created with IntelliJ IDEA.
 * Description:
 */

import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        float n = scanner.nextFloat();
        int m = (int)n;
        System.out.println(m%10);
    }
}
